<template>
    <div class="m-doctor-list">
        <no-data v-if="doctorList.length<1 && !loading"></no-data>
        <doctor-item class="m-doctor-item" v-for="(item,index) in doctorList" :key="index" :doctor="item"></doctor-item>
    </div>
</template>
<script>
import {doctorlist} from '@/api/views';
export default {
    name:'',
    data () {
        return {
            pageNo:1,
            doctorList:[],
            loading:true,
        }
    },
    components: {
        doctorItem:()=>import('@/model/doctor/doctorItem'),
    },
    methods: {
        // 美容师列表
        getDoctor() {
        let that = this;
        doctorlist({ page: this.pageNo, list_rows: 10 })
            .then(res => {
            that.doctorList = res.list.data;
            this.$indicator.close();
            this.loading = false;
            })
            .catch(error => {this.$indicator.close();});
        },
    },
    mounted() {
        this.$indicator.open('加载中...');
        this.getDoctor();
    }
}
</script>
<style lang="less" scoped>
.m-doctor-list{
    .flex;
    flex-wrap: wrap;
    padding: .8rem;
    .m-doctor-item{
        width: 49%;
        padding-right: 2%;
        margin-bottom: 1rem;
        &:nth-child(2n) {
            padding-right: 0;
        }
    }
}
</style>
